<div>
    <h5><?php echo $this->trans->_($this->info['title']) ?></h5>
    <form id="dataForm" onsubmit="return false;" method="post" action="" >
        <table class="sub-group info-table" width="100%">
        <?php foreach ($this->permisions as $name => $cat){ ?>

                    <tr data-gname="<?php echo $name ?>">
                        <td  class="titleGroup" colspan="2">
                        <h4 style="cursor: pointer; color: #0088BB" onclick="$('tr.<?php echo $name ?>').toggle('slow')"><?php echo $cat['title'] ?></h4>
                        <input type="hidden" name="<?php echo $name ?>[title]" value="<?php echo $cat['title'] ?>" />
                        </td>
                        <td style="vertical-align: middle; text-align: right; width: 40px;">
                            <img onclick="globalModule.addNewModule(this)" style="float: none; cursor: pointer" src="/img/icon_add.gif" title="Create new module" alt="<?php echo $this->trans->_('edit') ?>" width="16" height="16" />
                            <img onclick="globalModule.removePermGroup(this)" style="float: none; cursor: pointer" src="/img/icon_del.gif" title="Remove module" alt="Remove module" width="16" height="16"/>
                        </td>
                    </tr>
                    <?php
                        if(isset($cat['modules']) && count($cat['modules'])) {
                            foreach ($cat['modules'] as $mname => $module){ ?>

                            <tr class="<?php echo $name ?> hide">
                                <td class="titleItem"><?php echo $module['title'] ?></td>
                                <td class="permTD" data-sname="<?php echo $name ?>[modules][<?php echo $mname ?>][permissions]" data-module="<?php echo $mname ?>">
                                        <input type="hidden" name="<?php echo $name ?>[modules][<?php echo $mname ?>][title]" value="<?php echo $module['title'] ?>" />

                                        <?php
                                        if(isset($module['permissions']) && count($module['permissions'])) {
                                            foreach ( $module['permissions'] as $pname => $perm ) { ?>
                                                <span data-name="<?php echo $mname.'-'.str_replace('_', ' ', $pname); ?>" data-base-name="<?php echo $name ?>[modules][<?php echo $mname ?>][permissions][<?php echo $pname ?>]" data-module="<?php echo $mname ?>" style="color: #000">
                                                    <?php echo str_replace('_', ' ', $pname) ?>
                                                        <img onclick="globalModule.editActionPermissions(this)" style="float: none; cursor: pointer" src="/img/icon_edit.gif" title="<?php echo $this->trans->_('edit') ?>" alt="<?php echo $this->trans->_('edit') ?>" width="10" height="10" />
                                                        <img onclick="globalModule.removeActionPermissions(this)" style="float: none; cursor: pointer" src="/img/icon_del.gif" title="<?php echo $this->trans->_('_remove') ?>" alt="<?php echo $this->trans->_('_remove') ?>" width="10" height="10"/>
                                                        &nbsp;&nbsp;&nbsp;
                                                </span>
                                                <div style="display: none" class="<?php echo $mname.'-'.str_replace('_', ' ', $pname); ?>">
                                                    <?php $i=0; foreach ( $perm as $pm => $p ) { ?>
                                                        <input type="hidden" name="<?php echo $name ?>[modules][<?php echo $mname ?>][permissions][<?php echo $pname ?>][<?php echo $i ?>]" value="<?php echo $p ?>" />
                                                    <?php $i++; } ?>
                                                </div>
                                    <?php } } ?>
                                </td>
                                <td>
                                                    <img onclick="globalModule.addActionPermissions(this)" style="float: none; cursor: pointer" src="/img/plus.gif" title="<?php echo $this->trans->_('add_new_permissions') ?>" alt="<?php echo $this->trans->_('edit') ?>" width="16" height="16" />
                                                    <img onclick="globalModule.removePerm(this)" style="float: none; cursor: pointer" src="/img/icon_del.gif" title="<?php echo $this->trans->_('_remove') ?>" alt="<?php echo $this->trans->_('_remove') ?>" width="16" height="16"/>
                                </td>
                            </tr>
                    <?php } } ?>
        <?php } ?>
            </table>
    </form>
    <a onclick="globalModule.createGlobalGroupPerm()" style="position:relative; top:-3px; color: #0088BB" href="#">Create new item&nbsp;<img src="/img/plus.gif" width="16" height="16"/></a>
    <div id="removeAction" class="hide"><?php echo $this->trans->_('remove_action_text') ?></div>
    <div id="addAction" class="hide"><strong><?php echo $this->trans->_('name') ?>:</strong> <input type="text" class="inp-txt" id="addNewAct" value=""/></div>
    <div id="addModuleDialog" class="hide">
        <strong><?php echo $this->trans->_('title') ?>:</strong> <input type="text" class="inp-txt valid" id="mTitle" value=""/>&nbsp;&nbsp;&nbsp;
        <strong><?php echo $this->trans->_('name') ?>:</strong> <input type="text" class="inp-txt valid" id="mName" value=""/>
    </div>
   
</div>